only enable sse-fixups when not on 64bit
authorØyvind Kolås <pippin@gimp.org>
Wed, 2 May 2012 21:48:54 +0000 (23:48 +0200)
committerØyvind Kolås <pippin@gimp.org>
Wed, 2 May 2012 21:48:54 +0000 (23:48 +0200)
babl/babl-cpuaccel.c
babl/babl-cpuaccel.h
extensions/sse-fixups.c
tests/float-to-8bit.c

index ee12fd6d03555d3b525a55892aba98b4dad9d39c..287c41e254c01100ac2a86ec32fe08295657b56c 100644 (file)
@@ -490,6 +490,10 @@ cpu_accel (void)
 
   accel = arch_accel ();
 
+#if defined(ARCH_X86_64)
+  accel |= BABL_CPU_ACCEL_X86;
+#endif
+
   return (BablCpuAccelFlags) accel;
 
 #else /* !HAVE_ACCEL */
index c95af9135b6854fa2cafaffd48584de529239d58..e701e2afdd14525ae5369e463a0dea7ca5beca55 100644 (file)
@@ -32,7 +32,8 @@ typedef enum
   BABL_CPU_ACCEL_X86_SSE3    = 0x02000000,
 
   /* powerpc accelerations */
-  BABL_CPU_ACCEL_PPC_ALTIVEC = 0x04000000
+  BABL_CPU_ACCEL_PPC_ALTIVEC = 0x04000000,
+  BABL_CPU_ACCEL_X86_64      = 0x00100000
 } BablCpuAccelFlags;
 
 
index b44bb5e80241bc2d3bc365861fd11bf5a8c69d13..fdcc06f7e98a570ccd7a62c5a962413d135e6946 100644 (file)
@@ -228,7 +228,8 @@ init (void)
     NULL);
 
   if ((babl_cpu_accel_get_support () & BABL_CPU_ACCEL_X86_MMX) &&
-      (babl_cpu_accel_get_support () & BABL_CPU_ACCEL_X86_SSE))
+      (babl_cpu_accel_get_support () & BABL_CPU_ACCEL_X86_SSE) &&
+      !(babl_cpu_accel_get_support () & BABL_CPU_ACCEL_X86_64))
     {
       o (rgbaF_linear, rgb8_linear);
       o (rgbaF_linear, rgba8_linear);
index f415e96ebc7ede924894e26568bea02cc486a433..17300a3dd1f68f6869f69af15fb14d8ae8a808b0 100644 (file)
@@ -31,7 +31,11 @@ main (int    argc,
 {
   int OK = 1;
   babl_init ();
+  int i = 0;
 
+  
+  for (i = 0; i < 400000; i++)
+  {
   {
     float in[][4]   = {{ 0.21582, -0.55, -0.14, 1.0 }, {0.2, 0.3, 0.5, 0.6}, {0.0, 1.0, 2.0, 3.0}};
     unsigned char out[][4]  = {{ 55, 0, 0, 255 }, {51,77,128,153}, {0,255,255,255}};
@@ -91,6 +95,7 @@ main (int    argc,
         babl_format("R'G'B'A u8"),
         in, out);
   }
+  }
 
   babl_exit ();
   return !OK;